package com.ray.project.splash;

import com.ray.project.oceanicwaveinformation.OceanicBuoyMapViewActivity;
import com.ray.project.oceanicwaveinformation.R;
import com.ray.project.rssreader.rssreader;
import com.ray.project.seismograph.Seismograph;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import android.view.View;
import android.widget.Button;
import android.widget.Toast;


public class Splash extends Activity {

	Button mapView;
	Button rssFeed;
	Button seismograph;
	Button ndbcMobileSite;
	Button settings;
	Button help;
	
	
	@Override
    public void onCreate(final Bundle icicle) {
        super.onCreate(icicle);
        this.setContentView(R.layout.splash);
    }

    @Override
    public void onStart() {
        super.onStart();
        mapView = (Button)findViewById(R.id.map_view);
        rssFeed = (Button)findViewById(R.id.rss_feed);
        seismograph = (Button)findViewById(R.id.seismograph);
        ndbcMobileSite = (Button)findViewById(R.id.ndbc_mobile_site);
        settings = (Button)findViewById(R.id.app_settings);
        help = (Button)findViewById(R.id.app_help);
        hookButtons();
           
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    public void hookButtons(){
    	mapView.setOnClickListener(new Button.OnClickListener(){
    		public void onClick(View v){
    			 startActivity(new Intent(Splash.this, OceanicBuoyMapViewActivity.class));
    		}
    	});
    	rssFeed.setOnClickListener(new Button.OnClickListener(){
    		public void onClick(View v){
    			startActivity(new Intent(Splash.this, rssreader.class));
    			 Toast.makeText(v.getContext(), "RSS Feed", Toast.LENGTH_LONG).show();    			 
    		}
    	});
    	seismograph.setOnClickListener(new Button.OnClickListener(){
    		public void onClick(View v){
    			startActivity(new Intent(Splash.this, Seismograph.class));
    			 Toast.makeText(v.getContext(), "Seismograph", Toast.LENGTH_LONG).show();    			 
    		}
    	});
    	
    	ndbcMobileSite.setOnClickListener(new Button.OnClickListener(){
    		public void onClick(View v){
    			startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.ndbc.noaa.gov/mobile/")));    			    			 
    		}
    	});
    	settings.setOnClickListener(new Button.OnClickListener(){
    		public void onClick(View v){
    			startActivity(new Intent(Splash.this, com.ray.project.settings.Settings.class));    			 
    		}
    	});
    	help.setOnClickListener(new Button.OnClickListener(){
    		public void onClick(View v){
    			 Toast.makeText(v.getContext(), "Help", Toast.LENGTH_LONG).show();    			 
    		}
    	});
    }
}
